let obj = {
    a: 123,
    v: '22',
    c: {
        d: 222
    }
};
let p = new Proxy(obj, {})

// 1. Proxy 没有原型对象
Proxy.prototype // undefined
// 2. 不能使用instanceof
obj instanceof Proxy // TypeError: Function has non-object prototype 'undefined' in instanceof check
p instanceof Proxy // TypeError: Function has non-object prototype 'undefined' in instanceof check
// 3. 使用严格等于，Proxy不等于被代理对象
console.log(p === obj) // false

let p2 = new Proxy(obj, {
    get(target, prop, receiver) {
        console.log("Proxy 2: Get prop: ", prop);
        return target[prop];
    }
})

let p3 = new Proxy(p2, {
    get(target, prop, receiver) {
        console.log("Proxy 3: Get prop: ", prop);
        return Reflect.get(...arguments);
    }
})

const {proxy, revoke} = Proxy.revocable(obj, {
    get(target, prop, receiver) {
        console.log("Get prop: ", prop);
        return Reflect.get(...arguments);
    }
})



const target = {
    fn() {
        return this === proxy;
    }
}
const proxy = new Proxy(target, {});